package com.hoshiicloud.gateway.feign.fallback;

import com.hoshiicloud.auth.vo.LoginVO;
import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.gateway.feign.AuthService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@Slf4j
public class HystrixAuthFeignFallback implements FallbackFactory<AuthService> {

    @Override
    public AuthService create(Throwable throwable) {
        log.error("fallback; reason was:"+throwable.toString());
        return new AuthService() {
            @Override
            public Response login(String userName, String password, String userType, String platformId) {
                return null;
            }

            @Override
            public Response logout() {
                return null;
            }

            @Override
            public Response storeLogin(Long storeId, String token) {
                return null;
            }

            @Override
            public Response platformLogin(Long platformId, String token) {
                return null;
            }

            @Override
            public Response memberAccessToken(String token) {
                return null;
            }

            @Override
            public Response<LoginVO> companyUserLogin(String token) {
                return null;
            }
        };
    }
}
